const db=require('mongoose')
var foodSchema=new db.Schema({
    name:{type:String,required:true},
    price:{type:String,required:true},
    desc:{type:String,required:true},
    typename:{type:String,required:true},
    typeid:{type:Number,required:true},
    img:{type:String,required:true}
})

//将Schema转为数据模型
var Food=db.model('foods',foodSchema)//数据对象跟集合关联
module.exports=Food